// Borland C++ Builder
// Copyright (c) 1995, 1999 by Borland International
// All rights reserved

// (DO NOT EDIT: machine generated header) 'ZDirMySql.pas' rev: 5.00

#ifndef ZDirMySqlHPP
#define ZDirMySqlHPP

#pragma delphiheader begin
#pragma option push -w-
#pragma option push -Vx
#include <ZSqlTypes.hpp>	// Pascal unit
#include <ZTransact.hpp>	// Pascal unit
#include <Math.hpp>	// Pascal unit
#include <Db.hpp>	// Pascal unit
#include <ZLibMySql.hpp>	// Pascal unit
#include <ZDirSql.hpp>	// Pascal unit
#include <SysUtils.hpp>	// Pascal unit
#include <Windows.hpp>	// Pascal unit
#include <SysInit.hpp>	// Pascal unit
#include <System.hpp>	// Pascal unit

//-- user supplied -----------------------------------------------------------

namespace Zdirmysql
{
//-- type declarations -------------------------------------------------------
class DELPHICLASS TDirMySqlConnect;
class PASCALIMPLEMENTATION TDirMySqlConnect : public Zdirsql::TDirConnect 
{
	typedef Zdirsql::TDirConnect inherited;
	
private:
	AnsiString FError;
	
protected:
	virtual System::ShortString __fastcall GetErrorMsg(void);
	
public:
	__fastcall TDirMySqlConnect(void);
	__fastcall virtual ~TDirMySqlConnect(void);
	virtual void __fastcall Connect(void);
	virtual void __fastcall Disconnect(void);
	virtual void __fastcall CreateDatabase(AnsiString Params);
	virtual void __fastcall DropDatabase(void);
};


class DELPHICLASS TDirMySqlTransact;
class PASCALIMPLEMENTATION TDirMySqlTransact : public Zdirsql::TDirTransact 
{
	typedef Zdirsql::TDirTransact inherited;
	
private:
	Zlibmysql::MYSQL FHandle;
	AnsiString FError;
	
protected:
	virtual System::ShortString __fastcall GetErrorMsg(void);
	
public:
	__fastcall TDirMySqlTransact(TDirMySqlConnect* AConnect);
	virtual void __fastcall Open(void);
	virtual void __fastcall Close(void);
	virtual void __fastcall StartTransaction(void);
	virtual void __fastcall EndTransaction(void);
	virtual void __fastcall Commit(void);
	virtual void __fastcall Rollback(void);
	__property Zlibmysql::MYSQL Handle = {read=FHandle};
public:
	#pragma option push -w-inl
	/* TDirTransact.Destroy */ inline __fastcall virtual ~TDirMySqlTransact(void) { }
	#pragma option pop
	
};


class DELPHICLASS TDirMySqlQuery;
class PASCALIMPLEMENTATION TDirMySqlQuery : public Zdirsql::TDirQuery 
{
	typedef Zdirsql::TDirQuery inherited;
	
private:
	Zlibmysql::MYSQL_RES *FHandle;
	bool FStoreResult;
	char * *FRow;
	
protected:
	virtual System::ShortString __fastcall GetErrorMsg(void);
	virtual bool __fastcall GetEof(void);
	
public:
	__fastcall TDirMySqlQuery(TDirMySqlConnect* AConnect, TDirMySqlTransact* ATransact);
	__fastcall virtual ~TDirMySqlQuery(void);
	virtual int __fastcall Execute(void);
	virtual void __fastcall Open(void);
	virtual void __fastcall Close(void);
	virtual void __fastcall ShowDatabases( System::ShortString &DatabaseName);
	virtual void __fastcall ShowTables( System::ShortString &TableName);
	virtual void __fastcall ShowColumns( System::ShortString &TableName,  System::ShortString &ColumnName
		);
	virtual void __fastcall ShowIndexes( System::ShortString &TableName);
	virtual void __fastcall First(void);
	virtual void __fastcall Last(void);
	virtual void __fastcall Prev(void);
	virtual void __fastcall Next(void);
	virtual void __fastcall Go(int N);
	virtual int __fastcall FieldCount(void);
	virtual int __fastcall RecordCount(void);
	virtual System::ShortString __fastcall FieldName(int FieldNum);
	virtual int __fastcall FieldSize(int FieldNum);
	virtual int __fastcall FieldMaxSize(int FieldNum);
	virtual int __fastcall FieldType(int FieldNum);
	virtual Db::TFieldType __fastcall FieldDataType(int FieldNum);
	virtual bool __fastcall FieldIsNull(int FieldNum);
	virtual AnsiString __fastcall Field(int FieldNum);
	virtual char * __fastcall FieldBuffer(int FieldNum);
	virtual int __fastcall FieldDecimals(int FieldNum);
	int __fastcall FieldFlags(int FieldNum);
	virtual AnsiString __fastcall StringToSql(AnsiString Value);
	__property Zlibmysql::PMYSQL_RES Handle = {read=FHandle};
	__property bool StoreResult = {read=FStoreResult, write=FStoreResult, nodefault};
};


//-- var, const, procedure ---------------------------------------------------
static const Word LIST_BLOCK_SIZE = 0x1f4;
static const Shortint MIN_FETCH_ROWS = 0x0;
static const Shortint MAX_NAME_LENGTH = 0x32;
static const Shortint MAX_LINKS_COUNT = 0x5;
static const Shortint MAX_SORT_COUNT = 0x5;
static const Byte MAX_FIELD_COUNT = 0xff;
static const Shortint MAX_INDEX_COUNT = 0x19;
static const Shortint MAX_INDEX_FIELDS = 0x19;
static const Shortint DEFAULT_STRING_SIZE = 0x32;
static const Word MAX_STRING_SIZE = 0x200;
static const char DEFAULT_MACRO_CHAR = '\x25';
#define ZEOS_PALETTE "Zeos Common"
#define ZEOS_DB_PALETTE "Zeos Access"
static const Word ZDBO_VERSION = 0xc47c;
extern PACKAGE Ztransact::TZZMonitorList* MonitorList;
extern PACKAGE Db::TFieldType __fastcall MySqlToDelphiType(Byte Value, int Flags);
extern PACKAGE Db::TFieldType __fastcall MySqlToDelphiTypeDesc(AnsiString Value, int &Size, int &Precision
	, bool AlternativeView);

}	/* namespace Zdirmysql */
#if !defined(NO_IMPLICIT_NAMESPACE_USE)
using namespace Zdirmysql;
#endif
#pragma option pop	// -w-
#pragma option pop	// -Vx

#pragma delphiheader end.
//-- end unit ----------------------------------------------------------------
#endif	// ZDirMySql
